import request from '@/utils/request'

const baseUrl = '/spoken/course'

// 查询课程表列表
export function listCourse(query) {
  return request({
    url: baseUrl +'/list',
    method: 'get',
    params: query
  })
}

// 查询课程表详细
export function getCourse(courseId) {
  return request({
    url: baseUrl + '/' + courseId,
    method: 'get'
  })
}

// 新增课程表
export function addCourse(data) {
  return request({
    url: baseUrl,
    method: 'post',
    data: data
  })
}

// 修改课程表
export function updateCourse(data) {
  return request({
    url: baseUrl,
    method: 'put',
    data: data
  })
}

// 删除课程表
export function deleteCourse(courseId) {
  return request({
    url: baseUrl + '/' + courseId,
    method: 'delete',
  })
}

// 校验是否可以修改或删除
export function checkIsExist(courseId){
  return request({
    url: baseUrl + '/check/' + courseId,
    method: 'get'
  })
}